package com.lagou.config;

import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;

import java.io.InputStream;

/**
 * @Authther: mrwu
 * @date:2021/3/12-03
 * @Description:com.lagou.config
 */
public class Config {
    private SqlSession sqlSession;
    public Config() {
        try {
            InputStream inputStream = Resources.getResourceAsStream("sqlMapconfig.xml");
            sqlSession = new MybatisSqlSessionFactoryBuilder().build(inputStream).openSession(true);

        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public SqlSession getSqlSession() {
        return sqlSession;
    }
}
